package com.zhongyu.service.impl;


import com.zhongyu.mapper.XSreportMapper;
import com.zhongyu.pojo.GoodsType;
import com.zhongyu.pojo.OrderDetail;
import com.zhongyu.pojo.XsView;
import com.zhongyu.pojo.Xsreport;
import com.zhongyu.service.XSreportService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

@Service("XSreportService")
public class XSreportServicelmpl implements XSreportService {
    @Resource
    private XSreportMapper xSreportMapper;
    @Override
    public List<Xsreport> orderReport(LocalDateTime startDate , LocalDateTime endDate) {              //LocalDateTime startDate,LocalDateTime endDate
        if((startDate==null)&&(endDate==null)){
            return xSreportMapper.findOrderReport1();
        }
        return xSreportMapper.findOrderReport(startDate,endDate);
    }

    @Override
    public List<Xsreport> search() {
        return xSreportMapper.findAll();
    }
    @Override
    public List<XsView> findAllbyYear(int year) {
        return xSreportMapper.findAllbyYear(year);
    }
}
